<!doctype html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0,maximum-scale = 1.0,user-scalable=no" >
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <script src="CodeMirror-2.22/lib/codemirror.js"></script>
    <link rel="stylesheet" href="CodeMirror-2.22/lib/codemirror.css">
    
    <script src="CodeMirror-2.22/mode/javascript/javascript.js"></script> 
    <script src="CodeMirror-2.22/mode/xml/xml.js"></script>
   
    <script src="CodeMirror-2.22/lib/util/simple-hint.js"></script>
    <script src="CodeMirror-2.22/lib/util/javascript-hint.js"></script>
   
<style> 


.property-table {
  border-spacing: 0px;
  border-collapse: collapse;
}

.property-table td { 
   vertical-align: top;
}

.property-table.readonly td {
  border-bottom: 1px solid #ccc;
}

.link-button {
  color: #000 !important;
  background-color: #eee;
  border: 1px solid #aaa;
  border-radius: 3px !important;
  float: right;
  padding: 0 7px;
  margin: 8px 4px;
  text-decoration: none !important;
}

.run {
  background-color: #8f8;
}

.disconnected {
  background-color: #f88;
}

.CodeMirror-scroll {
  height: auto; 
  overflow: visible;
}

.SuggestList div {
  font-weight: bold;
  padding: 7px;
  border-bottom: 1px solid #e7e7e7;
}

</style>
   
    <script>
      function loadTidejDocument(name) {
        var prefix = "projects/" + name + "/";
        var descriptor = eval("(" + localStorage.getItem(prefix + "descriptor.json") +")");
        var html = localStorage.getItem(prefix + "index.html");
        var scripts = "";
        for (var i = 0; i < descriptor.classes.length; i++) {
          var code = localStorage.getItem(prefix + "classes/" + descriptor.classes[i] + ".js");
          scripts += "<script>" + code + "<\/script>";
        }
        var main = localStorage.getItem(prefix + "main.js");
        scripts += "<script>" + main + "<\/script>";
        return html.replace("</body>", scripts + "</body>");
      }   
    
      var search = window.location.search;
      if (search) {
        parts = search.substring(1).split("&");
        for (var i = 0; i < parts.length; i++) {
          keyValue = parts[i].split("=");
          if (keyValue[0]=="run") {
            document.runTidej = loadTidejDocument(keyValue[1]);
            break;
          }
        }
      }
      
      if (document.runTidej) {
        var timer = setInterval(function(){
          if(/loaded|complete/.test(document.readyState)){
            clearInterval(timer);
            document.open("text/html", "replace");
            document.write(document.runTidej);
            document.close();
        }}, 100);
       } else {
        document.title = "Tidej";
        document.write("<script src='Tidej/Tidej.nocache.js'><\/script>");
      }
    </script>
  </head>

  <body id="tidej-body">
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    <noscript>
      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
      </div>
    </noscript>
    <script>
    </script>
  </body>
</html>
